const Mt = require('./tree')
const m = new Mt()

let data = 
[
    {
        "parent_id": "0",
        "system_key": "267dbb4c766829a31586eaf29dd4b899",
        "name": "系统管理",
        "route_name": "",
        "icon": "appstore",
        "sort": 0,
        "remark": "系统管理",
        "updated": "2017-09-26T15:37:37.352Z",
        "status": 0,
        "created": "2017-09-26T15:37:37.352Z",
        "id": "59ca76c0ec54565586f9364f"
    },
    {
        "parent_id": "59ca76c0ec54565586f9364f",
        "system_key": "267dbb4c766829a31586eaf29dd4b899",
        "name": "系统列表",
        "route_name": "SystemsList",
        "icon": "",
        "sort": 1,
        "remark": "系统列表",
        "updated": "2017-09-26T15:37:37.352Z",
        "status": 0,
        "created": "2017-09-26T15:37:37.352Z",
        "id": "59ca77c6ec54565586f93651"
    },
    {
        "parent_id": "59ca76c0ec54565586f9364f",
        "system_key": "267dbb4c766829a31586eaf29dd4b899",
        "name": "添加系统",
        "route_name": "SystemsCreate",
        "icon": "",
        "sort": 2,
        "remark": "添加系统",
        "updated": "2017-09-26T15:37:37.352Z",
        "status": 0,
        "created": "2017-09-26T15:37:37.352Z",
        "id": "59ca780bec54565586f93652"
    },
    {
        "parent_id": "0",
        "system_key": "267dbb4c766829a31586eaf29dd4b899",
        "name": "角色管理",
        "route_name": "",
        "icon": "users",
        "sort": 1,
        "remark": "角色管理",
        "updated": "2017-09-26T17:14:04.700Z",
        "status": 0,
        "created": "2017-09-26T17:14:04.700Z",
        "id": "59ca8cece7ae926545fde90b"
    },
    {
        "parent_id": "59ca8cece7ae926545fde90b",
        "system_key": "267dbb4c766829a31586eaf29dd4b899",
        "name": "角色列表",
        "route_name": "RolesList",
        "icon": "",
        "sort": 0,
        "remark": "角色列表",
        "updated": "2017-09-26T17:14:04.700Z",
        "status": 0,
        "created": "2017-09-26T17:14:04.700Z",
        "id": "59ca8d0ee7ae926545fde90c"
    },
    {
        "parent_id": "59ca8d0ee7ae926545fde90c",
        "system_key": "267dbb4c766829a31586eaf29dd4b899",
        "name": "删除角色",
        "route_name": "RolesDestroy",
        "icon": "",
        "sort": null,
        "remark": "删除角色",
        "updated": "2017-09-26T17:14:04.700Z",
        "status": 0,
        "created": "2017-09-26T17:14:04.700Z",
        "id": "59ca8ef3e7ae926545fde90d"
    },
    {
        "parent_id": "59ca8d0ee7ae926545fde90c",
        "system_key": "267dbb4c766829a31586eaf29dd4b899",
        "name": "编辑角色",
        "route_name": "RolesEdit",
        "icon": "",
        "sort": 2,
        "remark": "编辑角色",
        "updated": "2017-09-26T17:14:04.700Z",
        "status": 0,
        "created": "2017-09-26T17:14:04.700Z",
        "id": "59ca996be7ae926545fde90e"
    }
]

let d = m.getMenus(data)
console.log(d)